<?php

use Illuminate\Database\Seeder;

class QuestionTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $faker = Faker\Factory::create("zh_CN");
        $s_arr = ['A', 'B', 'C', 'D'];
        for ($i = 0; $i < 20; $i++) {
            $data = [
                'question'     => $faker->sentence($nbWords = 6, $variableNbWords = true),
                'type'         => mt_rand(1, 2),
                'select'       => $faker->sentence($nbWords = 6) . '##XD' . $faker->sentence($nbWords = 6) . '##XD' . $faker->sentence($nbWords = 6) . '##XD' . $faker->sentence($nbWords = 6),
                'selectnumber' => 4,
                'answer'       => $s_arr[mt_rand(0, 3)],
                'intro'        => 'dananjiexi',
                'level'        => mt_rand(1, 4),
                'subject'      => mt_rand(86,87),
                'sections'     =>  mt_rand(1,2),
                'points'       => mt_rand(1, 8),
                'order'        => mt_rand(1, 100),
                'author'       => mt_rand(1, 5),
                'status'       => rand(1, 2),
                'created_at'   => date('y-m-d H:i:s', time()),

            ];
            DB::table('question')->insert($data);
        }


    }
}
